import request from "@/router/axios";

export const getParentList = (current, size,params) => {
  return request({
    url: '/api/hg-logistics/inventory/unpack/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}


export const getChildList = (current, size, pid,params) => {
  return request({
    url: '/api/hg-logistics/inventory/unpack/item/list',
    method: 'get',
    params: {
      ...params,
      pid,
      current,
      size,
    }
  })
}

export const printBox = (boxPrintReq) => {
  return request({
    url: '/api/hg-logistics/print/printBox',
    method: 'post',
    data: boxPrintReq,
    responseType:'blob',
  })
}

export const boxInfo = (boxCode) => {
  return request({
    url: '/api/hg-logistics/inventory/manage/getByBoxCode',
    method: 'get',
    params: {
      boxCode,
    }
  })
}


export const addQuick = (quickUnpackReq) => {
  return request({
    url: '/api/hg-logistics/inventory/unpack/quick',
    method: 'post',
    data: quickUnpackReq,
  })
}

export const printBoxDetail = (id) => {
  return request({
    url: '/api/hg-logistics/inventory/unpack/print',
    method: 'get',
    params: {id,},
    responseType:'blob',
  })
}

export const getSelectBoxList = (current, size, materialId,params) => {
  return request({
    url: '/api/hg-logistics/inventory/manage/list',
    method: 'get',
    params: {
      ...params,
      materialId,
      lock:'0',
      inventoryType:'2',
      current,
      size,
    }
  })
}

export const perview = (data) => {
  return request({
    url: '/api/hg-logistics/inventory/unpack/preUnpack',
    method: 'post',
    data:data
  })
}

export const getInventory = (boxCode) => {
  return request({
    url: '/api/hg-logistics/inventory/manage/getByBoxCode',
    method: 'get',
    params:{
      boxCode,
  }
  })
}

export const getStep5BoxList = (inventoryId) => {
  return request({
    url: '/api/hg-logistics/inventory/manage/getSkuDetail',
    method: 'get',
    params:{
      inventoryId,
    }
  })
}


export const getNewBoxCode = (materialId) => {
  return request({
    url: '/api/hg-logistics/inventory/unpack/new/boxCode',
    method: 'get',
    params:{
      materialId,
    }
  })
}

export const unpack = (data) => {
  return request({
    url: '/api/hg-logistics/inventory/unpack/unpack',
    method: 'post',
    data:data
  })
}
